const express = require('express')

const expressJoi = require('@escook/express-joi')

const artcate_handler = require('../router_handler/artcate')

const router = express.Router()

const {add_cate_schema,delete_cate_schema,get_cate_schema,update_cate_schema} = require('../schema/artcate')



router.get('/cates',artcate_handler.getArtcileCates)

///新增文章分类
router.post('/addcates',expressJoi(add_cate_schema),artcate_handler.addArtcileCates)

//根据id删除分类文章
router.get('/deletecate/:id',expressJoi(delete_cate_schema),artcate_handler.deleteCateById)

// 根据id获取文章分类数据
router.get('/cates/:id',expressJoi(get_cate_schema),artcate_handler.getArtcileById)

//根据ID更新文章文磊数据
router.post('/updatecate',expressJoi(update_cate_schema),artcate_handler.updateCateById)

module.exports =router